package com.lxmes.base.service.impl;

import java.util.List;

import com.lxmes.base.domain.JcWarehouseinfoKuwei;
import com.lxmes.common.annotation.DataScope;
import com.lxmes.common.utils.DateUtils;
import com.lxmes.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lxmes.base.mapper.JcWarehouseinfoMapper;
import com.lxmes.base.domain.JcWarehouseinfo;
import com.lxmes.base.service.IJcWarehouseinfoService;

/**
 * 仓库管理Service业务层处理
 * 
 * @author 张志煜
 * @date 2022-06-11
 */
@Service
public class JcWarehouseinfoServiceImpl implements IJcWarehouseinfoService 
{
    @Autowired
    private JcWarehouseinfoMapper jcWarehouseinfoMapper;

    /**
     * 查询仓库管理
     * 
     * @param id 仓库管理主键
     * @return 仓库管理
     */
    @Override
    public JcWarehouseinfo selectJcWarehouseinfoById(Long id)
    {
        return jcWarehouseinfoMapper.selectJcWarehouseinfoById(id);
    }

    @Override
    public List<JcWarehouseinfo> selectJcWarehouseinfoDeptId(String deptId) {
        return jcWarehouseinfoMapper.selectJcWarehouseinfoDeptId(deptId);
    }

    /**
     * 查询仓库管理列表
     * 
     * @param jcWarehouseinfo 仓库管理
     * @return 仓库管理
     */
    @Override
    public List<JcWarehouseinfo> selectJcWarehouseinfoList(JcWarehouseinfo jcWarehouseinfo)
    {
        jcWarehouseinfo.setTenantId(SecurityUtils.getFactoryCode());
        return jcWarehouseinfoMapper.selectJcWarehouseinfoList(jcWarehouseinfo);
    }

    @Override
    public List<JcWarehouseinfo> selectJcWarehouseinfoList1(JcWarehouseinfo jcWarehouseinfo) {
        jcWarehouseinfo.setTenantId(SecurityUtils.getFactoryCode());
        return jcWarehouseinfoMapper.selectJcWarehouseinfoList1(jcWarehouseinfo);
    }

    /**
     * 新增仓库管理
     * 
     * @param jcWarehouseinfo 仓库管理
     * @return 结果
     */
    @Override
    public int insertJcWarehouseinfo(JcWarehouseinfo jcWarehouseinfo)
    {
        jcWarehouseinfo.setTenantId(SecurityUtils.getFactoryCode());
        jcWarehouseinfo.setCreateTime(DateUtils.getNowDate());
        return jcWarehouseinfoMapper.insertJcWarehouseinfo(jcWarehouseinfo);
    }

    /**
     * 修改仓库管理
     * 
     * @param jcWarehouseinfo 仓库管理
     * @return 结果
     */
    @Override
    public int updateJcWarehouseinfo(JcWarehouseinfo jcWarehouseinfo)
    {
        jcWarehouseinfo.setUpdateTime(DateUtils.getNowDate());
        return jcWarehouseinfoMapper.updateJcWarehouseinfo(jcWarehouseinfo);
    }

    /**
     * 批量删除仓库管理
     * 
     * @param ids 需要删除的仓库管理主键
     * @return 结果
     */
    @Override
    public int deleteJcWarehouseinfoByIds(Long[] ids)
    {
        return jcWarehouseinfoMapper.deleteJcWarehouseinfoByIds(ids);
    }

    /**
     * 删除仓库管理信息
     * 
     * @param id 仓库管理主键
     * @return 结果
     */
    @Override
    public int deleteJcWarehouseinfoById(Long id)
    {
        return jcWarehouseinfoMapper.deleteJcWarehouseinfoById(id);
    }
}
